module ContractQuery
  def self.query_by_employee employee
    Contract.where(employee_id: employee["id"])
  end

  def self.find_valid_certificates
    Contract.where("valid_end <= '#{Time.now.to_date}'")
  end

  def self.find_will_valid_certificates
    Contract.where("recheck_time <= '#{Time.now.to_date}' and valid_end > '#{Time.now.to_date}'")
  end
end
